package com.sailing.lianxi.thread;

/**
 *创建线程方式2-实现Runnable接口
 * @author Administrator
 *
 */
public class MyRunnable implements Runnable {

	private int num =10;
	
	public void run() {
		for(int i=0;i<10;i++){
			System.out.println(Thread.currentThread().getName()+",value="+num--);
		}
	}
	
	public static void main(String[] args) {
		 for(int i=0;i<2;i++){
			 Thread t1 = new Thread(new MyRunnable());
			 t1.start();
		 }
	}

	
}
